<?php
$this->breadcrumbs=array(Lang::t('account.list.page.title'));
?>

<div class="page-nav text-right">
    <a href="<?php echo $this->addNewUrl; ?>" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Add New</a>
</div>

<?php $this->getFlashes(array('class'=>'alert alert-{status}')); ?>
<!--<div class="alert alert-info"><?php echo Lang::t('account.list.form.note'); ?></div>-->

<?php //$this->widget('AdvancedSearchWidget', array('formView' => '_search', 'account' => $account, 'address' => $address)); ?>

<?php
$dataProvider->pagination->pageSize = Yii::app()->request->getParam('pageSize_', 10);
$this->widget('ext.extended.GridView', array(
    'id' => 'grid',
    'dataProvider' => $dataProvider,
    'filter' => $account,
    'rowHtmlOptionsExpression' => implode('; ', array(
        '$data->defaultImage="' . $this->imagesPath . '/account-default.png"',
    )),
    'htmlOptions'=>array(
        'class'=>'table-responsive',
    ),
    'itemsCssClass'=>'table table-hover',
    'dropDowns' => array(
        'pageSize' => array(
            'label' => 'Results per page',
            'dropDownVar' => 'pageSize_',
            'cssClass' => 'page-size',
            'default' => 10,
            'items' => array(
                10 => 10,
                20 => 20,
                50 => 50,
                80 => 80,
                100 => 100,
            ),
        ),
    ),
    'columns' => array(
        array(
            'filterHtmlOptions'=>array('class'=>'id-filter'),
            'name' => 'id_',
            'value' => '$data->id',
            'htmlOptions' => array(
                'class' => 'id-column',
            ),
        ),
        array(
            'name' => 'image_',
            'filter' => false,
            'type' => 'image',
            'value' => '$data->thumbnail',
            'htmlOptions' => array(
                'class' => 'grid-image',
            ),
        ),
        array(
            'name' => 'name_',
            'value' => '$data->name',
            'htmlOptions' => array(
                'style' => 'width:300px; text-align:left;',
            ),
        ),
        array(
            'name' => 'type_',
            'filter' => $account->typeOption,
            'value' => '$data->type',
        ),
        array(
            //'name' => 'city_',
            'value' => '$data->addressCity',
        ),
        array(
            //'name' => 'country_',
            'filter' => $address->countryOption,
            'value' => '$data->addressCountry',
            'htmlOptions' => array(
                'style' => 'width:80px; text-align:center;',
            ),
        ),
        array(
            'name' => 'status_',
            'value' => '$data->status',
            'filter' => $account->statusOption,
            'htmlOptions' => array(
                'style' => 'width:80px; text-align:center;',
            ),
        ),
        array(
            'class' => 'CButtonColumn',
        ),
        array(
            'class' => 'CCheckBoxColumn',
            'selectableRows' => 2,
        ),
    ),
));
?>